#ifndef TEXTURE_HPP
#define TEXTURE_HPP

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <string>
#include <Rendering/Enumeration.hpp>
#include <Tools/SmartPointer.hpp>

namespace Rendering {

//-----------------------------------------------------------------------------
class ITexture;
typedef Tools::SmartPointer<ITexture> TITexturePointer;
//-----------------------------------------------------------------------------
class ITexture {
public:
	// Constructor
	//ITexture(PixelFormat format, int width, int height);
	ITexture(TextureType type, PixelFormat format, int width, int height, TRenderingID textureID);
	// Destructor
	virtual ~ITexture();
	// Enable texture to texture unit
	virtual void Enable(int unit) const;
	// Disable texture to texture unit
	virtual void Disable(int unit) const;
protected:
	// Type of texture
	TextureType type;
	// Texture ID
	TRenderingID textureID;
	// Pixel format
	PixelFormat format;
	// Image size
	int width, height;
};
//-----------------------------------------------------------------------------
class TextureManager {
public:		
	// Enable shader ID
	TITexturePointer CreateTexture(const std::string& filename, PixelFormat format=PIX_R8G8B8A8) const;	
	TITexturePointer CreateCubeTexture(	const std::string filenames[6], PixelFormat format=PIX_R8G8B8A8) const;
	// Destructor
	~TextureManager();
	// Get texture manager instance
	static TextureManager& Instance();
private:
	// Get number of mipmap level
	int GetMaxMipsMapLevel(int width, int height);
	// Constructor
	TextureManager();
	TextureManager(const TextureManager& copy);
	TextureManager& operator=(const TextureManager& copy);	
};
//-----------------------------------------------------------------------------
}

#endif //TEXTURE_HPP
